/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.biz.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 物料表Entity
 * @author Lai_Hanzhang
 * @version 2019-03-11
 */
@Table(name="biz_goods", alias="a", columns={
		@Column(name="goods_id", attrName="goodsId", label="主键", isPK=true),
		@Column(name="goods_code", attrName="goodsCode", label="物料编码", queryType=QueryType.LIKE),
		@Column(name="goods_name", attrName="goodsName", label="物料名称", queryType=QueryType.LIKE),
		@Column(name="goods_score", attrName="goodsScore", label="物料价格"),
		@Column(name="goods_quantity", attrName="goodsQuantity", label="库存量"),
		@Column(name="goods_info", attrName="goodsInfo", label="物料描述", isQuery=false),
		@Column(name="state", attrName="state", label="物料状态"),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="create_time", attrName="createTime", label="创建时间", isQuery=false),
		@Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
		@Column(name="update_time", attrName="updateTime", label="更新时间", isQuery=false),
		@Column(name="remarks", attrName="remarks", label="备注", isQuery=false),
	}, orderBy="a.goods_id DESC"
)
public class BizGoods extends DataEntity<BizGoods> {
	
	private static final long serialVersionUID = 1L;
	private String goodsId;		// 主键
	private String goodsCode;		// 物料编码
	private String goodsName;		// 物料名称
	private Double goodsScore;		// 物料价格
	private Double goodsQuantity;		// 库存量
	private String goodsInfo;		// 物料描述
	private String state;		// 物料状态
	private Date createTime;		// 创建时间
	private Date updateTime;		// 更新时间
	
	public BizGoods() {
		this(null);
	}

	public BizGoods(String id){
		super(id);
	}
	
	public String getGoodsId() {
		return goodsId;
	}

	public void setGoodsId(String goodsId) {
		this.goodsId = goodsId;
	}
	
	@NotBlank(message="物料编码不能为空")
	@Length(min=0, max=50, message="物料编码长度不能超过 50 个字符")
	public String getGoodsCode() {
		return goodsCode;
	}

	public void setGoodsCode(String goodsCode) {
		this.goodsCode = goodsCode;
	}
	
	@NotBlank(message="物料名称不能为空")
	@Length(min=0, max=200, message="物料名称长度不能超过 200 个字符")
	public String getGoodsName() {
		return goodsName;
	}

	public void setGoodsName(String goodsName) {
		this.goodsName = goodsName;
	}
	
	@NotNull(message="物料价格不能为空")
	public Double getGoodsScore() {
		return goodsScore;
	}

	public void setGoodsScore(Double goodsScore) {
		this.goodsScore = goodsScore;
	}
	
	public Double getGoodsQuantity() {
		return goodsQuantity;
	}

	public void setGoodsQuantity(Double goodsQuantity) {
		this.goodsQuantity = goodsQuantity;
	}
	
	@Length(min=0, max=2000, message="物料描述长度不能超过 2000 个字符")
	public String getGoodsInfo() {
		return goodsInfo;
	}

	public void setGoodsInfo(String goodsInfo) {
		this.goodsInfo = goodsInfo;
	}
	
	@Length(min=0, max=10, message="物料状态长度不能超过 10 个字符")
	public String getState() {
		return state;
	}

	public void setState(String state) {
		this.state = state;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	
	public Double getGoodsScore_gte() {
		return sqlMap.getWhere().getValue("goods_score", QueryType.GTE);
	}

	public void setGoodsScore_gte(Double goodsScore) {
		sqlMap.getWhere().and("goods_score", QueryType.GTE, goodsScore);
	}
	
	public Double getGoodsScore_lte() {
		return sqlMap.getWhere().getValue("goods_score", QueryType.LTE);
	}

	public void setGoodsScore_lte(Double goodsScore) {
		sqlMap.getWhere().and("goods_score", QueryType.LTE, goodsScore);
	}
	
	public Double getGoodsQuantity_gte() {
		return sqlMap.getWhere().getValue("goods_quantity", QueryType.GTE);
	}

	public void setGoodsQuantity_gte(Double goodsQuantity) {
		sqlMap.getWhere().and("goods_quantity", QueryType.GTE, goodsQuantity);
	}
	
	public Double getGoodsQuantity_lte() {
		return sqlMap.getWhere().getValue("goods_quantity", QueryType.LTE);
	}

	public void setGoodsQuantity_lte(Double goodsQuantity) {
		sqlMap.getWhere().and("goods_quantity", QueryType.LTE, goodsQuantity);
	}
	
}